from django.db import models

# Create your models here.


class User(models):
    username = models.ForeignKey(User_informations,verbose_name="用户名")
    passwd = models.CharField(verbose_name="密码",max_length=128)
    email = models.CharField(verbose_name='邮箱',max_length=128)
    user_collect = models.ForeignKey(Question_bank,verbose_name="用户收藏")
    user_already = models.ManyToManyField(Already_question,verbose_name="已经刷过的题目",related_name="user_set",max_length=128)

class Already_question(models):
    al_name = models.ForeignKey(Question_bank,verbose_name="已经刷过的题目")
    al_comment = models.CharField(verbose_name="评论",max_length=128)
    al_answer = models.CharField(verbose_name="答案",max_length=128)
    #刷题的时间
    al_data = models.DateTimeField(auto_now_add=True)

class User_informations(models):
    user_image = models.ImageField(verbose_name="用户图像")
    user_introduce = models.ImageField(verbose_name="个性签名")




class Question_bank(models):
    question_name = models.CharField(verbose_name="题目名字",max_length=128)
    question_type = models.ForeignKey(verbose_name="题目类型")
    question_particulars =models.CharField(verbose_name="题目",max_length=128)
    question_diff = models.ForeignKey(verbose_name="题目难度")
    question_complete = models.ForeignKey(Already_question,verbose_name="题目完成量")


class Question_type(models):
    type_name = models.CharField(verbose_name="类型名字",max_length=128)

class Diff(models):
    diff_class = models.CharField(verbose_name="题目难度",max_length=64)


class Nav(models):
    Nav_type = models.CharField(verbose_name="导航",max_length=128)
